package com.wxprogram.smallprogram.controller;


import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.wxprogram.smallprogram.entity.City;
import com.wxprogram.smallprogram.entity.MajorType;
import com.wxprogram.smallprogram.entity.School;
import com.wxprogram.smallprogram.service.ViewInfoService;

@RestController
public class UserDeliverReqController {
	@Autowired
	private ViewInfoService viewInfoService;
	
	/**
	 * 获取城市及学校和专业类型
	 * @return city
	 */
	@RequestMapping("/choose")
	public List getField(@RequestParam(name="cityname",required = false) String cityname,@RequestParam(name="schoolname",required = false) String schoolName){
			return  viewInfoService.getChoice(cityname,schoolName);
	}

	/**
	 * 获取城市及学校和专业类型及专业
	 * @param cityname
	 * @param schoolName
	 * @param majortype
	 * @return
	 */
	@GetMapping("/getitem")
	public List getChoice(@RequestParam(name="cityname",required = false) String cityname,@RequestParam(name="schoolname",required = false) String schoolName,
						  @RequestParam(name = "majortype",required = false) String majortype){

			return  viewInfoService.getItem(cityname,schoolName,majortype);
	}
	
}
